home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / BSP Tree Demo / precompile / precompile.PPC.pch++ < prev   
Encoding:
Text File  |  1995-03-26  |  6.2 KB  |  122 lines  |  [TEXT/MMCC]

  1. #define    SystemSevenOrLater    1
  2.  
  3. //------------------------------------------------------------------------------
  4. //    Apple System headers
  5. //------------------------------------------------------------------------------
  6. #include <AppleEvents.h>
  7. #include <AERegistry.h>
  8. #include <EPPC.h>
  9. #include <Errors.h>
  10. #include <StandardFile.h>
  11. #include <Script.h>
  12. #include <Files.h>
  13. #include <Events.h>
  14. #include <Quickdraw.h>
  15. #include <QDOffscreen.h>
  16. #include <Windows.h>
  17. #include <Dialogs.h>
  18. #include <Fonts.h>
  19. #include <Memory.h>
  20. #include <Desk.h>
  21. #include <Menus.h>
  22. #include <ToolUtils.h>
  23. #include <TextUtils.h>
  24. #include <Resources.h>
  25. #include <Notification.h>
  26. #include <Folders.h>
  27. #include <Aliases.h>
  28. #include <GestaltEqu.h>
  29. #include <Threads.h>
  30. #include <LowMem.h>
  31. #include <OSUtils.h>
  32. #include <Packages.h>
  33. #include <DiskInit.h>
  34. #include <Sound.h>
  35. #include <Timer.h>
  36. #include <Icons.h>
  37. #include <SegLoad.h>
  38.  
  39. //------------------------------------------------------------------------------
  40. //    ANSI headers
  41. //------------------------------------------------------------------------------
  42. #include <limits.h>
  43. #include <float.h>
  44. #include <math.h>
  45. #include <stdarg.h>
  46.  
  47. //------------------------------------------------------------------------------
  48. //    defines
  49. //------------------------------------------------------------------------------
  50. #define    USE_FLOATS                                                                                                                            //    whether or not the real type is a float
  51.  
  52. //------------------------------------------------------------------------------
  53. //    types
  54. //------------------------------------------------------------------------------
  55. typedef    unsigned short    ushort;                                                                                                    //    abbreviation
  56. typedef    unsigned long        ulong;                                                                                                    //    abbreviation
  57. typedef    unsigned char        uchar;                                                                                                    //    abbreviation
  58. typedef    char                        *cstr;                                                                                                    //    a C style string (NULL terminated)
  59. typedef    uchar                        *pstr;                                                                                                    //    a pascal style string (preceded by a length byte)
  60. #ifdef    USE_FLOATS                                                                                                                            //    if the real type is a float
  61. typedef    float                        real;                                                                                                        //    common name for floating point type
  62. #else                                                                                                                                                        //    otherwise
  63. typedef    double                    real;                                                                                                        //    common name for floating point type
  64. #endif                                                                                                                                                    //    end
  65.  
  66. //------------------------------------------------------------------------------
  67. //    enumerations
  68. //------------------------------------------------------------------------------
  69. enum        bool {FALSE = 0, TRUE = 1};                                                                                            //    simple boolean type
  70.  
  71. //------------------------------------------------------------------------------
  72. //    macros
  73. //------------------------------------------------------------------------------
  74. #ifdef    USE_FLOATS                                                                                                                            //    if the real type is a float
  75. #define    R(num)    (num ## F)                                                                                                            //    want constants to have an F after them to specify float types
  76. #else                                                                                                                                                        //    otherwise
  77. #define    R(num)    (num)                                                                                                                        //    want constants to have an L after them to specify long double types
  78. #endif                                                                                                                                                    //    end
  79.  
  80. #define    TopLeft(r)    (((Point *) &(r))[0])                                                                                //    an easy way to get a point from a rectangle
  81. #define    BotRight(r)    (((Point *) &(r))[1])                                                                                //    an easy way to get a point from a rectangle
  82. #define    hiword(val)    ((ulong (val) & 0xFFFF0000) >> 16)                                                    //    make a short from the hiword of a long word
  83. #define    loword(val)    (val & 0x0000FFFF)                                                                                    //    want only the low word of a long word
  84.  
  85. //------------------------------------------------------------------------------
  86. //    synonyms
  87. //------------------------------------------------------------------------------
  88. #ifdef    USE_FLOATS                                                                                                                            //    if the real type is a float
  89. #define    COS        cosf                                                                                                                            //    use float version of function for speed
  90. #define    ACOS    acos                                                                                                                            //    use float version of function for speed
  91. #define    SIN        sinf                                                                                                                            //    use float version of function for speed
  92. #define    ASIN    asinf                                                                                                                            //    use float version of function for speed
  93. #define    TAN        tan                                                                                                                                //    use float version of function for speed
  94. #define    ATAN    atanf                                                                                                                            //    use float version of function for speed
  95. #define    ATAN2    atan2f                                                                                                                        //    use float version of function for speed
  96. #define    SQRT    sqrtf                                                                                                                            //    use float version of function for speed
  97. #define    FABS    fabsf                                                                                                                            //    use float version of function for speed
  98. #define    POW        powf                                                                                                                            //    use float version of function for speed
  99. #else                                                                                                                                                        //    otherwise, use the double versions
  100. #define    COS        cos                                                                                                                                //    use normal version of function
  101. #define    ACOS    acos                                                                                                                            //    use normal version of function
  102. #define    SIN        sin                                                                                                                                //    use normal version of function
  103. #define    ASIN    asin                                                                                                                            //    use normal version of function
  104. #define    TAN        tan                                                                                                                                //    use normal version of function
  105. #define    ATAN    atan                                                                                                                            //    use normal version of function
  106. #define    ATAN2    atan2                                                                                                                            //    use normal version of function
  107. #define    SQRT    sqrt                                                                                                                            //    use normal version of function
  108. #define    FABS    fabs                                                                                                                            //    use normal version of function
  109. #define    POW        pow                                                                                                                                //    use normal version of function
  110. #endif                                                                                                                                                    //    end real type is a float
  111.  
  112. //------------------------------------------------------------------------------
  113. //    constants
  114. //------------------------------------------------------------------------------
  115. //const        real    INFINITY = R(100000.0);                                                                                        //    floating point infinity value
  116. const        real    EPSILON = R(1.0) / R(100000.0);                                                                        //    floating point epsilon value
  117. #ifndef    PI
  118. const        real    PI = R(3.14159265358979323846);                                                                        //    pi
  119. #endif
  120. const        real    TWO_PI = PI * R(2.0);                                                                                            //    two times pi
  121.  
  122.